<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <span>今天天气真{{info}}</span>
        <button @click="toggle">切换</button>
    </div>
    <script>
        Vue.config.productionTip = false;

        let vm = new Vue({
            el: '#root',
            data: {
                ishot:true,
            },
            computed:{
                info(){
                    return this.ishot==true?"炎热":"凉快";
                }
            },
            methods: {
                toggle(){
                    // 取反
                    this.ishot = !this.ishot;
                }
            },
        });
    </script>
</body>
</html>